<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "asr_audio_classify".
 *
 * @property int $audio_classify_id 语音分类的id
 * @property string $name 名字
 * @property int $create_at 创建时间
 *
 * @property AsrAudio[] $asrAudios
 */
class AsrAudioClassify extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'asr_audio_classify';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['audio_classify_id'], 'integer'],
            [['audio_classify_id'], 'unique'],
            [['name'], 'string', 'max' => 30],
            [['create_at'], 'default','value'=>time()],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'name' => '分类名称',
            'create_at' => '创建时间',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getAsrAudios()
    {
        return $this->hasMany(AsrAudio::className(), ['audio_classify_id' => 'audio_classify_id']);
    }
}
